package com.dh.random;

import java.util.Random;

public class RandomDemo01 {
    public static void main(String[] args) {
//        Random random = new Random();
//        int i = random.nextInt(10);//0-9
//        System.out.println(i);

        Random random1 = new Random(10);// 种子

        for (int j = 0; j < 5; j++) {
            System.out.println(random1.nextInt(10));
        }
        System.out.println("-------------------------------------------");
        Random random2 = new Random(10);// 种子
        for (int j = 0; j < 5; j++) {
            System.out.println(random2.nextInt(10));
        }
    }
}
